 package com.vieewer.btdemo

import android.app.Dialog
import android.content.Context
import android.widget.ProgressBar
import android.widget.Toast

/**
 * @author yjj
 * @version 1.0
 * @date 2019/5/21
 * @since 1.0
 */
var pd: Dialog ? = null
fun Context.showLoading() {
    pd = Dialog(this,R.style.CustomDialogTheme)
    pd!!.setContentView(ProgressBar(this))
    pd!!.show()
}

fun Context.dismiss() {
    if (pd != null) {
        if (pd!!.isShowing) {
            pd!!.dismiss()
        }
    }
}

fun Context.t(msg: String) {
    Toast.makeText(this, msg, Toast.LENGTH_LONG).show()
}